package com.yunhe.sms.view;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/8/7 0007.
 */
public class Index {
    public static int indexUI(){
        System.out.println("********************学员信息管理系统********************");
        System.out.println("1.讲师登录");
        System.out.println("2.管理员登录");
        System.out.print("请输入操作序号：");
        Scanner sc = new Scanner(System.in);
        try {
            int i = sc.nextInt();
            if (i < 1||i >2)
                throw new Exception("操作码未识别！");
            return i;
        }catch (Exception e){
            String message = e.getMessage();
            if (message != null)
                System.out.println(message);
            else
                System.out.println("操作错误！");
            return indexUI();
        }
    }
}
